<template>
  <div class="login" >
    <div class="header">
      <div :class="{ active: isActive, 'noActive': hasError }" @click="login">学/工号登录</div>
      <div :class="{ active: !isActive, 'noActive': !hasError }" @click="loginmail">邮箱登录</div>
    </div>

    <input type="text" class="school" placeholder="高校">
    <input type="text" class="stynum" placeholder="学/工号">
    <input type="text" class="password" placeholder="密码">

    <div class="findPsd" @click="loginbind">忘记密码？</div>

    <button class="numLoginbtn">登录</button>
  </div>
</template>

<script>
export default {
  name: "Login",
  data() {
    return {
      msg: "login",
      isActive: true,
      hasError: false
    };
  },
  methods: {
    //学工号登录 默认
    login() {
      this.$router.push("/");
      let isActive = this.isActive;
      let hasError = this.hasError;
      this.isActive = isActive ? isActive : !isActive;
      this.hasError = !hasError ? hasError : !hasError;
    },
    //邮箱登录
    loginmail() {
      this.$router.push("/loginmail");
      this.isActive = !this.isActive;
      this.hasError = !this.hasError;
    },
    //平台绑定
    loginbind() {
      this.$router.push("/loginbind");
    }
  }
};
</script>

<style scoped lang="scss">
.findPsd {
  color: #eb8543;
  float: right;
  position: relative;
  right: 5%;
  font-size: 13px;
}
.header {
  width: 90%;
  height: 20%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.school,
.stynum,
.password {
  padding-left: 1vw;
  height: 9%;
  width: 80%;
  margin: 3% 10%;
  border-radius: 5px;
  border: 0.5px solid #999999;
  box-shadow: 1px 1px 1px #999999;
}
.numLoginbtn {
  height: 12%;
  width: 60%;
  border-radius: 5px;
  background: #eb8543;
  border: none;
  outline: none; //消除默认点击蓝色边框效果
  color: #fff;
  margin: 7% 20%;
}
.numLoginbtn:active {
  background: #f87521;
}

// 移动端
@media screen and (max-width: 500px) {
  .active {
    height: 30%;
    padding: 0 6% 5%;
    border-bottom: 1px solid #eb8543;
    color: #eb8543;
  }
  .login {
    width: 80%;
    height: 90%;
    margin: 2% auto;
    .header {
      .noActive {
        height: 30%;
        padding: 0 6% 5%;
        color: #999999;
      }
    }
  }
}

// pc端
@media screen and (min-width: 500px) {
  .active {
    height: 40%;
    width: 40%;
    padding: 0 3% 3%;
    text-align: center;
    border-bottom: 1px solid #eb8543;
    color: #eb8543;
  }
  .login {
    width: 30%;
    height: 100%;
    margin: 1% auto;
    .header {
      .noActive {
        height: 40%;
        width: 40%;
        padding: 0 3% 3%;
        text-align: center;
        color: #999999;
      }
    }
  }
}
</style>
